package lx.triangle;

public class Triangle {

	public int triangle(int a, int b, int c){
		// is triangle
		if(a<=0 || b<=0 || c<=0){
			return -1;
		}
		if(a+b <= c || a+c <= b || b+c <= a){
			return -1;
		}
		int count = 0;
		if(a == b) count++;
		if(b == c) count++;
		if(a == c) count++;
		switch (count){
		case 0:
			// scalene
			return 0;
		case 1:
			// isosceles
			return 1;
		case 3:
			// equilateral
			return 2;
		default:
			return -1;
		}
	}

}
